1. Field of the Invention
The present invention relates to the field of software architectures for a computer system running multiple Java Virtual Machines (JVMs). More specifically, the present invention relates to a software architecture that can be used for audio/visual digital devices including embedded systems.
2. Related Art
Many computer operating systems require Java for various applications including home networking applications, MPEG applets and other desktop and Internet applications. One such home networking application is the HAVi (Home Audio/Video Interoperability) application as described in a reference entitled xe2x80x9cHAVI: an IT architecture for interoperability in the home network,xe2x80x9d by Rodger Lea and Aaron Ludtke, SRF97, which is cited herein as background. Given the wide range of target platforms and applications that can be hosted by computer operating systems, in both IT (Information Technology) and consumer electronics markets, it is desired that PersonalJava (pJava) be supported on various types of devices such as, for instance, set-top boxes, consumer electronic (CE) devices and digital televisions (DTVs).
Moreover, the implementation of the standard Java Virtual Machine (JVM) on personal computers (PCs) or on workstations allows applications to be developed in Java by programmers who do not necessarily understand the operating system of the host computer system. In one example, this host computer operating system is the Aperios operating system available from Sony Corporation. Because Aperios"" AVIOS is a highly configurable, real-time and micro-kernel platform, it would be advantageous that highly compact and memory efficient implementations of the JVM be implemented on top of it. For instance, it would be advantageous to port PersonalJava to the Aperios""s AVIOS environment. Heretofore, this has not been done for a number of reasons.
One problem is that PersonalJava does not currently support Audio Video (AV) applications, which need more flexible functionality to adequately handle certain functionality such as volume data handling and transfer, device and stream control management, message passing, event management and communication with native applications. Therefore, it would be advantageous to design and build a dedicated environment for the implementation of a Java system infrastructure which would help AV applications.
There are other problems with respect to running Java systems on dedicated environments, e.g., an embedded computer system or other intelligent electronic device. Namely, embedded computer systems do not have the memory resources required to support Java systems. FIG. 1 illustrates a software architecture where a single computer system is running multiple JVMs 11-14 simultaneously. Each JVM installs, into memory, its own copy of the Java classes which are required to allow the respective JVM to operate. For instance, JVM 11 installs classes 21 for its own use, JVM 12 installs classes 22 for its own use, JVM 13 installs classes 23 for its own use and JVM 14 installs classes 24 for its own use. However, many of the installed Java classes are copies of the same class, e.g., class A and class B are copied and are individually used by many of the JVMs. The size of these classes, and the fact that each JVM needs its own copy, makes it very difficult to run multiple JVMs simultaneously on a single computer system. This is especially true for embedded computer systems which lack robust memory resources. What is needed is a system and method for allowing efficient use of memory resources when operating Java on a dedicated environment.
Moreover, when Java systems are running on dedicated environments, there is presently no effective way to pass messages between native applications and JVM applications or between two or more JVM applications. What is needed is a system and method for allowing efficient message passing between native applications and JVM applications, or between two or more JVM applications, within a dedicated environment.
Accordingly, the present invention provides a system and method for allowing efficient use of memory resources when operating Java on a dedicated environment, e.g., an embedded computer system or other intelligent electronic device. The present invention further provides a system and method for allowing efficient message passing functionality between native applications and JVM applications, and between two or more JVM applications, within the dedicated environment. Specifically, what is disclosed herein is a novel class sharing model for minimizing the memory footprint of multiple JVMs running on a dedicated computer system, e.g., an embedded system. Embodiments of the present invention also include a model for mapping different physical devices installed with their own file management and a model for external applications to communicate with PersonalJava.
To reduce the memory footprint of the JVMs, a computer-implemented method and system are described for allowing Java classes to be shared among many Java Virtual Machines (JVMs) and this system includes a communication system allowing Java and native applications (or two or more JVM applications) to readily interoperate. Various features of JAVA, like xe2x80x9cwrite once, run everywhere,xe2x80x9d compactness, standardized APIs (application program interfaces) and the availability of advanced tool kits all make JAVA a very attractive platform for applications. A software framework described herein, referred to as xe2x80x9cJavaLayer,xe2x80x9d (or Java layer) allows various coexisting applications to share resources and provide an optimal run-time environment. The JavaLayer enables Java and native applications to interoperate easily, manage class sharing and aids by efficient garbage collection.
An implementation of the JVM on an operating system platform, e.g., the Aperios AV/OS, allows a variety of applications including desktop applications, applets and Internet based applications, home networking applications, MPEG applets, gaming, gaming applications and next generation audio visual applications to operate with the operating system. The present invention provides a shared memory pool (SMP) into which a JVM can store and register a particular Java class for subsequent use by itself or by other JVMs. The stored and registered Java class is accessible by other JVMs using the SMP and a Java layer class manager (JCM) that is implemented in software. The JCM requires other JVMs to access a key for the stored class in order to synchronize access to the Java class among several installed and operating JVMs of the computer system. By sharing common Java classes in this fashion, the memory resource overhead required to operate multiple JVMs on a common computer system is drastically reduced thereby allowing a multiple JVM platform to be operable on an embedded computer system.
A novel communication method is also disclosed for communicating information between a JVM application and a native application, or between two or more JVMs, using the computer system""s operating system and the SMP. The novel communication method allows multiple JVM applications to communicate using the shared memory pool. These functions are incorporated into a JavaLayer that supports the full PersonalJava(trademark) platform.
More specifically, in a computer system having a processor coupled to a bus, a memory device coupled to the bus and a display screen coupled to the bus, embodiments of the present invention include a method of sharing Java classes comprising the steps of: a) a first Java Virtual Machine (JVM) loading an instantiation of a first Java class into a shared memory pool; b) registering a name of the first Java class into a name table for the shared memory pool; c) a second JVM querying the name table to determine if the first Java class is stored in the shared memory pool, wherein the second JVM is operating on the computer system simultaneously with the first JVM; and d) the second JVM accessing and utilizing the instantiation of the first Java class from the shared memory pool in lieu of creating a separate instantiation of the first Java class for its own use.